<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>添加新的产品</title>
<link href="css/bootstrap.min.css" type="text/css" rel="stylesheet" />
<link href="css/base.css" type="text/css" rel="stylesheet" />
<link href="css/main.css" type="text/css" rel="stylesheet" />
<script src="js/jquery.js"></script>
<script src="js/bootstrap.min.js"></script>
</head>
<body>
	<form action="/buy/AddPicture" method="post" enctype="multipart/form-data">
		<dt class="clearfix">请添加商品图片</dt>
		<input type="file" name="uploadFile" />
		<input type="submit" value="上传" />
	</form>
	<p><%if("文件上传成功!".equals(request.getSession().getAttribute("message"))){
		out.println("图片上传成功!");
		out.println("请继续输入商品详情");
	}else if("错误".equals(request.getSession().getAttribute("message"))){
		out.println("图片上传失败!");
	}else{
		out.println("");
	}
		 request.getSession().setAttribute("message","");%></p>
	<form action="/buy/AddProduct" >
		<dt class="clearfix">请输入商品名称</dt>
		<input type="text" name="name">
		<dt class="clearfix">请输入商品颜色</dt>
		<input type="text" name="color">
		<dt class="clearfix">请输入商品尺寸</dt>
		<input type="text" name="size">
		<dt class="clearfix">请输入商品价格</dt>
		<input type="text" name="price">
		<input type="submit" value="添加">
	</form>

	<label><%if(request.getSession().getAttribute("addproduct")!=null){
		out.println("恭喜你，添加商品成功！");
		request.getSession().removeAttribute("addproduct");
	} %></label>
	
	<a href="list.jsp">返回</a>
</body>
</html>